<?xml version="1.0" encoding="UTF-8"?>
<!--
Final stage of the job application. User will be able to see the application
as a whole before submiting it to the DB via controller to the model.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    
    <h:head>
        <title>IV1201 Project - Group 08</title>
        <meta name="keywords" content="IV1201 Project work for group 08."/>
        <meta name="author" content="Mustafa Hamra, Andreas Norberg, 
                                            Christian Castillo"/>
        <meta http-equiv="content-type" content="text/xhtml; charset=UTF-8"/>
        <link type="text/css" rel="stylesheet" href="CSS/screen.css"
                                                media="screen" />
    </h:head>
    <h:body>
        <div id="container">
            <div id="top">
                <div id="header">

                    <br/><br/><br/><br/><br/>

                    <div id="headerText">
                        IV1201<br/>
                        Group 8
                    </div>
                </div>
                <div id="menu">
                    <a href="index.xhtml">Home</a>
                    <a href="login.xhtml">Recruiter login</a>
                    <a href="apply.xhtml">Apply to job</a>
                </div>
            </div>

            <div id="body">
                <div class="post">
                    <fieldset>
                        <legend>
                            Application
                        </legend>
                        <div class="text">
                            Please enter the period(s) you can work.
                            Pattern: dd.MM.yyyy.
                            <h:form>
                                <h:outputText value ="From: "/>
                                <h:inputText value="#{userManager.dateFieldFrom}" id="dateFieldFrom" required="true">
                                <f:convertDateTime pattern="dd.MM.yyyy" dateStyle="short"/>
                                </h:inputText>
                                
                                <h:outputText value ="To: "/>
                                <h:inputText value="#{userManager.dateFieldTo}" id="dateFieldTo" required="true">
                                <f:convertDateTime pattern="dd.MM.yyyy" dateStyle="short"/>
                                </h:inputText>

                                <td>
                                    <h:commandButton value="Add" action="#{userManager.addDates}"/>                                   
                                </td>
                                
                                <td>
                                    <h:commandButton value="Clear" action="#{userManager.clearDates}"/>
                                </td>
                                
                            <td>
                                <ui:repeat var="o" value="#{userManager.dates}" varStatus="dates">             
                                    <p><b>From:</b> #{o.dateFieldFrom}    <b>To:</b> #{o.dateFieldTo}</p> 
                                </ui:repeat>
                            </td>
                            <!-- final stage. Submit job applicaiton -->
                            <p>
                                <h:commandButton value="Submit job application" action="#{userManager.submit}"/>
                                Please verify  your application before submiting it.
                            </p>
                                
                            </h:form>
                        </div>
                    </fieldset> 
                </div>
            </div>

            <div id="footer">
                <div class="right">
                </div>
                <p>
                    <ui:include src="include.xhtml" />
                </p>
            </div>
        </div>
    </h:body>
</html>